package valueObjects.game.card;

import java.io.Serializable;

import tools.MyTools;
import exception.card.NoCardException;

/**
 * This class represents the upperclass for all cards in this game.
 * 
 */
public abstract class Card implements Serializable{

	private static final long serialVersionUID = 1L;

	public static final String NOT_AVAILABLE = "NA";
	
	private String label;
	
	private String description;
	
	private String detailIcon;
	
	private String smallIcon;
	
	private String backIcon;

	/**
	 * Returns the detail icon of this card
	 * @return
	 */
	public String getDetailIcon() {
		return detailIcon;
	}

	/**
	 * Sets the detail icon of this card
	 * @param detailIcon
	 */
	public void setDetailIcon(String detailIcon) {
		this.detailIcon = detailIcon;
	}

	/**
	 * Returns the small icon of this card
	 * @return
	 */
	public String getSmallIcon() {
		return smallIcon;
	}

	/**
	 * Sets the small icon of this card
	 * @param smallIcon
	 */
	public void setSmallIcon(String smallIcon) {
		this.smallIcon = smallIcon;
	}

	/**
	 * Returns the type of this card.
	 * @return String type
	 */
	public abstract String getType();
	
	/**
	 * Returns the label of the card
	 * @return String label
	 */
	public String getLabel() {
		return label;
	}

	/**
	 * Sets the label for the card
	 * @param label
	 * @throws NoCardException 
	 */
	public void setLabel(String label) throws NoCardException {
		if(MyTools.isEmpty(label)){
			throw new NoCardException(this);
		}
		this.label = label;
	}

	/**
	 * Returns the description of the card
	 * @return String description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Sets the description of the card
	 * @param description
	 * @throws NoCardException 
	 */
	public void setDescription(String description) throws NoCardException {
		if(MyTools.isEmpty(description)){
			throw new NoCardException(this);
		}
		this.description = description;
	}
	
	/**
	 * Shows information about the card
	 */
	public String toString() {
		return (this.label + " / " + this.description);
	}

	public boolean isCard() {
		if(this.description == null || this.label == null){
			return false;
		}
		return true;
	}

	public String getBackIcon() {
		return backIcon;
	}

	public void setBackIcon(String backIcon) {
		this.backIcon = backIcon;
	}
	

}
